package pub.guoxin.server.simulation.service.impl;

import org.springframework.stereotype.Service;
import pub.guoxin.server.simulation.service.Sender;

/**
 * Create by guoxin on 2018/5/12
 */
@Service("udpSender")
public class UdpSender implements Sender {

    @Override
    public void send(String message) {

//        ByteBuf byteBuf = Unpooled.copiedBuffer(BinaryUtil.hexStr2Byte(message, message.length() / 2));
//        try (DatagramSocket socket = new DatagramSocket()) {
//
//            byte[] bytes = BinaryUtil.hexStr2Byte(message, message.length() / 2);
//            socket.send(new DatagramPacket(bytes, bytes.length, inetSocketAddress.getAddress(), inetSocketAddress.getPort()));
//            socket.close();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
    }

}
